(function($) {
	function resizeParallaxEntry() {
		var height = $(window).height();
		var width = $(window).width();

		height = parseInt(height)+'px';
		width = parseInt(width)+'px';

		$(".parallax-entry").css({'height':height, 'width':width, 'background-size':width+' '+height});
	}

	$(document).ready(function() {
		resizeParallaxEntry();
    	$(window).bind('resize', resizeParallaxEntry);
    	
		//$('#mistralice-nav').localScroll(800);
		
		//.parallax(xPosition, speedFactor, outerHeight) options:
		//xPosition - Horizontal position of the element
		//inertia - speed to move relative to vertical scroll. Example: 0.1 is one tenth the speed of scrolling, 2 is twice the speed of scrolling
		//outerHeight (true/false) - Whether or not jQuery should use it's outerHeight option to determine when a section is in the viewport
		$('#intro').parallax("50%", 0.1, true);
		$('#second').parallax("50%", 0.1, true);
		$('.bg').parallax("50%", 0.4, true);
		$('#third').parallax("50%", 0.1, true);
		$('#fourth').parallax("50%", 0.3, true);
	});
})(jQuery);